<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="/include/taglibs.jsp" %>
<html>
<head>
    <%@include file="/include/header.html" %>
    <script type="text/javascript" src="${ctx}/appjs/guide/guide.js"></script>
</head>

<script type="text/javascript">
    $('#topLink', window.parent.document).html(function (i, origText) {
        return'<ol class="breadcrumb">' +
            '<li class="breadcrumb-item">' +
            '<a href="">主页</a>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<a>运营管理</a>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<strong>新增文章</strong>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<a href="javascript:window.history.back()"><i class="fa fa-times"></i> 返回</a>' +
            '</li>' +
            '</ol>';
    });

</script>

<body class="gray-bg">
<div class="wrapper wrapper-content ">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <div class="columns pull-left">
                        <h5 class="font-bold">新增文章</h5>
                    </div>
                    <div class="ibox-tools">
                        <a class="close-link">
                            <i class="fa fa-times"></i>
                        </a>
                    </div>
                </div>

                <div class="ibox-content">
                    <form class="form-horizontal m-t" id="frmUserGuide">
                        <input type="hidden" class="form-control" id="guideType" name="guideType" value="1">
                        <div class="form-group row">
                            <label class="col-sm-3 col-form-label text-right">目录：</label>
                            <div class="col-sm-8">
                                <c:choose>
                                    <c:when test="${!empty userGuides }">
                                        <select class="form-control" name="parentId" id="parentId">
                                            <option value="">--请选择--</option>
                                            <c:forEach items="${userGuides}" var="userGuide">
                                                <option value="${userGuide.userGuideId}">${userGuide.content}</option>
                                            </c:forEach>
                                        </select>
                                    </c:when>
                                    <c:otherwise>
                                        <input type="text" class="form-control" value="" name="parentId"
                                               placeholder="请先添加目录"
                                               readonly>
                                    </c:otherwise>
                                </c:choose>
                            </div>
                        </div>
                        <div class="form-group row">
                            <label class="col-sm-3 col-form-label text-right">文章标题：</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" id="content" name="content">
                            </div>
                        </div>

                        <div class="form-group row">
                            <label class="col-sm-3 col-form-label text-right">链接地址：</label>
                            <div class="col-sm-8">
                                <input type="url" class="form-control" id="link" name="link">
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-3 col-sm-offset-8 text-right">
                                <button type="submit" class="btn btn-primary">提交</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    addGuide.init();
</script>
</body>
</html>
